<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

</head>
<body>
    请输入你的年份:<input id="num1" type="text">
    请输入你的月份:<input id="num2" type="text">
    请输入当月天数:<input id="num3" type="text">
    <button id="enter">检查当年第几天</button>
    <script>
        var num1 = document.getElementById("num1")
        var num2 = document.getElementById("num2")
        var num3 = document.getElementById("num3")
        var up = document.getElementById("enter")

var todayy = 0;


        up.onclick = function()
        {
            var year = parseInt(num1.value)
var mouth = parseInt(num2.value)
var day = parseInt(num3.value)
        switch(mouth){
case 12 : todayy += 31;
case 11 : todayy += 30;
case 10 : todayy += 31;
case 9 : todayy += 30;
case 8 : todayy += 31;
case 7 : todayy += 31;
case 6 : todayy += 30;
case 5 : todayy += 31;
case 4 : todayy += 30;
case 3 : todayy += 31;
case 2 : if(year/4 == 0 && year%100 !==0 || year%400 == 0){
    todayy += 29;
}
else{
    todayy += 28;
}
case 1 : todayy += day;

}







            console.log(todayy)
        }






    </script>
</body>
</html>